<?php
/**
 * Author: Administrator
 * Date: 2022/7/22 1:35
 */

namespace DesignPatterns\Structural\DependencyInjection;


class Connection
{
    protected $configuration;

    protected $host;

    public function __construct(Parameters $config)
    {
        $this->configuration = $config;
    }

    public function connect(): void
    {
        $host = $this->configuration->get('host');
        $this->host = $host;
    }

    public function getHost() {
        return $this->host;
    }

}